package com.heima.model.common.enums;

public enum AppHttpCodeEnum {

    // 成功段0
    SUCCESS(0,"操作成功"),
    // 登录段1~50
    NEED_LOGIN(1,"需要登录后操作"),
    LOGIN_PASSWORD_ERROR(2,"密码错误"),
    // TOKEN50~100
    TOKEN_INVALID(50,"无效的TOKEN"),
    TOKEN_EXPIRE(51,"TOKEN已过期"),
    TOKEN_REQUIRE(52,"TOKEN是必须的"),
    // SIGN验签 100~120
    SIGN_INVALID(100,"无效的SIGN"),
    SIG_TIMEOUT(101,"SIGN已过期"),
    // 参数错误 500~1000
    PARAM_REQUIRE(500,"缺少参数"),
    PARAM_INVALID(501,"无效参数"),
    PARAM_IMAGE_FORMAT_ERROR(502,"图片格式有误"),
    SERVER_ERROR(503,"服务器内部错误"),
    // 数据错误 1000~2000
    FANS_EXIST(1006,"粉丝已经存在不可以重复添加粉丝"),
    DATA_EXIST(1000,"数据已经存在"),
    AP_USER_DATA_NOT_EXIST(1001,"ApUser数据不存在"),
    DATA_NOT_EXIST(1002,"图片不存在"),
    DATA_NOT_EXIST_OR_COLLECTION(1003,"图片不存在,或者被收藏"),
    DATA_NOT_ENABLE_DELETE(1004,"文章已经发布不能够删除"),
    NEWS_NOT_EXIT(1005,"文章不存在"),
    NEWS_NOT_ISSUE(1005,"文章未发布,不能够进行上下架操作"),
    // 数据错误 3000~3500
    NO_OPERATOR_AUTH(3000,"无权限操作"),
    NEED_ADMIND(3001,"需要管理员权限"),
    UPLOAD_FILE_FAIL(3002,"上传文件失败"),
    //---------------------admin-------------
    IS_INVOKE_REJECT_DELETE(3100,"启用状态无法删除"),
    IS_DEFAULT_REJECT_DELETE(3101,"默认选项无法删除"),
    FIRST_NUMBER(3103,"第一个数值不能够上移"),
    LAST_NUMBER(3104,"最后一个数值不能够下移"),
    NUMBER_DOTEXIT_OR_CLOSURE(3105,"账号不存在或者被封停"),
    USERNAME_OR_PASSWORD_ERROR(3106,"账号或密码错误"),
    UNABLE_OBTAIN_USER_MSG(3107,"无法获取用户认证信息"),
    FAILD_CREATE_AUTHOR(3108,"创建作者信息失败"),
    FAILD_CREATE_MEDIA(3109,"创建作者信息失败"),
    DATA_ISUSED_UNABLEDELETE(3110,"图片正在被使用不能够删除"),
    DATA_UPDATA_FAIL(3111,"数据更新失败"),
    AUTHOR_MSG_DONT_EXIT(3112,"用.户信息非法"),
    TO_LONG_CONTENT(3113,"字符串太长,请重写"),
    ILLEGAL_OPERATION(3114,"非法操作"),
    IS_CONTAIN_SAME_NAME(3102,"包含相同的字段名,无法正常更新");

    int code;
    String errorMessage;

    AppHttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.errorMessage = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getErrorMessage() {
        return errorMessage;
    }
}
